package com.chidopi.market.bookstore.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.chidopi.cdf.service.IBaseService;
import com.chidopi.cdf.service.ICommonService;
import com.chidopi.cdf.service.impl.CommonServiceImpl;
import com.chidopi.market.bookstore.dao.DaoConfig;
import com.chidopi.market.bookstore.domain.BookCategories;
import com.chidopi.market.bookstore.domain.BookCities;
import com.chidopi.market.bookstore.domain.Brand;
import com.chidopi.market.bookstore.domain.ContextProvider;
import com.chidopi.market.bookstore.domain.ProductID2Book;
import com.chidopi.market.bookstore.domain.Subscribe4iOS;
import com.chidopi.market.bookstore.domain.Subscriptions;
import com.chidopi.market.bookstore.service.impl.BookCategoriesServiceImpl;
import com.chidopi.market.bookstore.service.impl.BookCitiesServiceImpl;
import com.chidopi.market.bookstore.service.impl.BookItemsServiceImpl;
import com.chidopi.market.bookstore.service.impl.BookZipBackupServiceImpl;
import com.chidopi.market.bookstore.service.impl.BrandServiceImpl;
import com.chidopi.market.bookstore.service.impl.ContextProviderServiceImpl;
import com.chidopi.market.bookstore.service.impl.ProductID2BookServiceImpl;
import com.chidopi.market.bookstore.service.impl.ResourceServiceImpl;
import com.chidopi.market.bookstore.service.impl.Subscribe4iOSServiceImpl;
import com.chidopi.market.bookstore.service.impl.SubscriptionsServiceImpl;


@Configuration("bookstoreServiceConfig")
@Import(DaoConfig.class)
public class ServiceConfig {
	private static Logger logger = LoggerFactory.getLogger(ServiceConfig.class);

	@Bean(name="commonService")
	public ICommonService commonService() {
		logger.debug("commonService is called!!");
		return new CommonServiceImpl();
	}

	@Bean(name="brandService")
	public IBaseService<Brand> brandService() {
		logger.debug("brandService is called!!");
		return new BrandServiceImpl();
	}
	
	@Bean(name="bookCategoriesService")
	public IBaseService<BookCategories> bookCategoriesService() {
		logger.debug("bookCategoriesService is called!!");
		return new BookCategoriesServiceImpl();
	}
	
	@Bean(name="contextProviderService")
	public IBaseService<ContextProvider> contextProviderService() {
		logger.debug("ContextProviderService is called!!");
		return new ContextProviderServiceImpl();
	}
	
	@Bean(name="bookItemsService")
	public IBookItemsService bookItemsService() {
		logger.debug("BookItemsService is called!!");
		return new BookItemsServiceImpl();
	}
	
	@Bean(name="resourceService")
	public IResourceService resourceService(){
		logger.debug("ResourceService is called");
		return new ResourceServiceImpl();
	}
	
	@Bean(name="backupService")
	public IBookZipBackupService bookZipBackupService(){
		logger.debug("BookZipBackupService is called");
		return new BookZipBackupServiceImpl();
	}
	
	@Bean(name="bookCitiesService")
	public IBaseService<BookCities> bookCitiesService(){
		logger.debug("BookCitiesService is called");
		return new BookCitiesServiceImpl();
	}
	
	@Bean(name="subscriptionsService")
	public IBaseService<Subscriptions> subscriptionsService(){
		logger.debug("SubscriptionsService is called");
		return new SubscriptionsServiceImpl();
	}
	
	@Bean(name="subscribe4iOSService")
	public IBaseService<Subscribe4iOS> subscribe4iOSService(){
		logger.debug("Subscribe4iOSServiceImpl is called");
		return new Subscribe4iOSServiceImpl();
	}
	
	@Bean(name="productID2BookService")
	public IBaseService<ProductID2Book> productID2BookService(){
		logger.debug("ProductID2BookServiceImpl is called");
		return new ProductID2BookServiceImpl();
	}
}
